package com.suse.warmstill.mapper;

import com.suse.warmstill.entity.TbUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 黄靖
 * @since 2022-10-19
 */
@Mapper
public interface TbUserMapper extends BaseMapper<TbUser> {

    @Update(" UPDATE tb_user SET status = #{status} WHERE id = #{userId}# ")
    void updateUserStatus(Long userId, int status);

    @Update("  UPDATE tb_user SET refresh_token = null WHERE id = #{userId}")
    void deleteRefreshTokenById(Long userId);

    @Update(" UPDATE tb_user SET status = 1 WHERE id = #{id}# ")
    void lock(Long id, int i);
}
